package com.nsoft.ui;

import com.nsoft.utils.Constant;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class BookTempViewFragment extends Fragment {
	
	int curPos=-1;
	
	@Override
	public View onCreateView(LayoutInflater inflater, 
			ViewGroup container,Bundle savedInstanceState) {
		
		if (savedInstanceState!=null){
			curPos=savedInstanceState.getInt(
				Constant.booklist.BLF_CURRENT_POSITION);
		}
		return super.onCreateView(
				inflater, container, savedInstanceState);
	}
	
	@Override
	public void onStart() {
		super.onStart();
		
		Bundle args=getArguments();
		if (args!=null){
			bookSelected(args.getInt(
				Constant.booklist.BLF_CURRENT_POSITION));
		}else if(curPos!=-1){
			bookSelected(curPos);
		}
	}
	
	public void bookSelected(int pos){
		
	}
	
	/*
	@Override
	public void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		outState.putInt(
				Constant.booklist.BLF_CURRENT_POSITION,
				curPos);
	}
	*/
}
